WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"WTreeView",function(j,d,i,y,s,D){function q(b){var a=-1,c=null,e=false,g=false,h=null;for(b=f.target(b);b&&b!=d;){if(f.hasTag(b,"LI")){if(a==-1)a=0;c=b.id;break}else if(b.className.indexOf("Wt-tv-c")==0){if(b.className.indexOf("Wt-tv-c")==0)a=b.className.split(" ")[0].substring(7)*1;else if(a==-1)a=0;if(b.getAttribute("drop")==="true")g=true;h=b}if($(b).hasClass(D))e=true;b=b.parentNode}return{columnId:a,nodeId:c,selected:e,drop:g,el:h}}function z(b,a){var c=
q(a);c.columnId!=-1&&j.emit(d,{name:"itemTouchEvent",eventObject:b,event:a},c.nodeId+":"+c.columnId,"touchstart","","")}function A(){if(t&&B)if(!f.isHidden(d)){t=false;var b=v.firstChild,a=p.firstChild,c=0,e=0,g=p.lastChild.className.split(" ")[0];e=f.getCssRule("#"+d.id+" ."+g);if(s)a=a.firstChild;for(var h=0,l=a.childNodes.length;h<l;++h)if(a.childNodes[h].className){var k=a.childNodes[h].className.split(" ")[0];k=f.getCssRule("#"+d.id+" ."+k);if(k.style.display!="none")c+=f.pxself(k,"width")+7}if(!s){if(f.isIE&&
$(document.body).hasClass("Wt-rtl"))if(h=f.getCssRule("#"+d.id+" .Wt-tv-row"))h.style.width=c+"px";if(e.style.width)$(d).find(".Wt-headerdiv ."+g).css("width",e.style.width);else{g=d.scrollWidth-a.offsetWidth-9-15;if(g>0)e.style.width=g+"px"}}if(e.style.width!="auto"){e=c+f.pxself(e,"width")+(f.isIE6?10:7);if(s){k=f.getCssRule("#"+d.id+" .Wt-tv-rowc");k.style.width=c+"px";j.layouts2.adjust();f.isIE&&setTimeout(function(){$(d).find(".Wt-tv-rowc").css("width",c+"px").css("width","")},0);d.changed=true}else{p.style.width=
b.style.width=e+"px";a.style.width=c+"px"}}}}jQuery.data(d,"obj",this);var v=i.firstChild,p=y.firstChild,w=this,f=j.WT,B=false;this.click=function(b,a){var c=q(a);c.columnId!=-1&&j.emit(d,{name:"itemEvent",eventObject:b,event:a},c.nodeId+":"+c.columnId,"clicked","","")};this.dblClick=function(b,a){var c=q(a);c.columnId!=-1&&j.emit(d,{name:"itemEvent",eventObject:b,event:a},c.nodeId+":"+c.columnId,"dblclicked","","")};this.mouseDown=function(b,a){f.capture(null);var c=q(a);if(c.columnId!=-1){j.emit(d,
{name:"itemEvent",eventObject:b,event:a},c.nodeId+":"+c.columnId,"mousedown","","");d.getAttribute("drag")==="true"&&c.selected&&j._p_.dragStart(d,a)}};this.mouseUp=function(b,a){var c=q(a);c.columnId!=-1&&j.emit(d,{name:"itemEvent",eventObject:b,event:a},c.nodeId+":"+c.columnId,"mouseup","","")};var m;this.touchStart=function(b,a){if(a.touches.length>1){clearTimeout(m);m=setTimeout(function(){z(b,a)},1E3)}else{clearTimeout(m);m=setTimeout(function(){z(b,a)},50)}};this.touchMove=function(b,a){a.touches.length==
1&&m&&clearTimeout(m)};this.touchEnd=function(){m&&clearTimeout(m)};this.rootClick=function(b,a){j.emit(d,{name:"itemEvent",eventObject:b,event:a},"","clicked","","")};this.rootDblClick=function(b,a){j.emit(d,{name:"itemEvent",eventObject:b,event:a},"","dblclicked","","")};this.rootMouseDown=function(b,a){j.emit(d,{name:"itemEvent",eventObject:b,event:a},"","mousedown","","")};this.rootMouseUp=function(b,a){j.emit(d,{name:"itemEvent",eventObject:b,event:a},"","mouseup","","")};this.resizeHandleMDown=
function(b,a){var c=b.parentNode.className.split(" ")[0];if(c){var e=f.getCssRule("#"+d.id+" ."+c),g=f.pxself(e,"width"),h=-g,l=1E4,k=$(document.body).hasClass("Wt-rtl");if(k){var x=h;h=-l;l=-x}new f.SizeHandle(f,"h",b.offsetWidth,d.offsetHeight,h,l,"Wt-hsh2",function(n){n=g+(k?-n:n);var r=c.substring(7)*1;e.style.width=n+"px";w.adjustColumns();j.emit(d,"columnResized",r,parseInt(n))},b,d,a,-2,-1)}};var t=false;this.adjustColumns=function(){if(!t){t=true;setTimeout(A,0)}};var o=null;d.handleDragDrop=
function(b,a,c,e,g){if(o){o.className=o.classNameOrig;o=null}if(b!="end"){var h=q(c);if(!h.selected&&h.drop&&h.columnId!=-1)if(b=="drop")j.emit(d,{name:"itemEvent",eventObject:a,event:c},h.nodeId+":"+h.columnId,"drop",e,g);else{a.className="Wt-valid-drop";o=h.el;o.classNameOrig=o.className;o.className+=" Wt-drop-site"}else a.className=""}};this.wtResize=function(){B=true;A();var b=$(d),a,c=null,e=f.pxself(d,"width");if(e==0)e=d.clientWidth;else if(f.boxSizing(d)){e-=f.px(d,"borderLeftWidth");e-=f.px(d,
"borderRightWidth")}var g=i.offsetWidth-i.clientWidth;if(g>50)g=0;if(i.clientWidth>0)e-=g;if(b.hasClass("column1")){a=b.find(".Wt-headerdiv").get(0).lastChild.className.split(" ")[0];a=f.getCssRule("#"+d.id+" ."+a);c=f.pxself(a,"width")}if((!f.isIE||e>100)&&(e!=i.tw||c!=i.c0w||d.changed)){var h=!d.changed;i.tw=e;i.c0w=c;a=b.find(".Wt-headerdiv").get(0).lastChild.className.split(" ")[0];a=f.getCssRule("#"+d.id+" ."+a);var l=v.firstChild,k=f.getCssRule("#"+d.id+" .cwidth"),x=k.style.width==l.offsetWidth+
1+"px",n=p.firstChild;k.style.width=e+"px";i.style.width=e+g+"px";if(!$(document.body).hasClass("Wt-rtl")){y.style.marginRight=g+"px";$("#"+d.id+" .Wt-scroll").css("marginRight",g+"px")}if(c!=null){c=e-c-(f.isIE6?10:7);if(c>0){var r=Math.min(c,f.pxself(f.getCssRule("#"+d.id+" .Wt-tv-rowc"),"width"));e-=c-r;p.style.width=e+"px";l.style.width=e+"px";f.getCssRule("#"+d.id+" .Wt-tv-row").style.width=r+"px";f.isIE&&setTimeout(function(){b.find(" .Wt-tv-row").css("width",r+"px").css("width","")},0)}}else if(x){p.style.width=
k.style.width;l.style.width=k.style.width}else p.style.width=l.offsetWidth+"px";if(!s&&l.offsetWidth-n.offsetWidth>=7)a.style.width=l.offsetWidth-n.offsetWidth-7+"px";d.changed=false;h&&w.adjustColumns()}};this.scrollTo=function(b,a,c,e){if(a!=-1){a*=c;b=i.scrollTop;var g=i.clientHeight;if(e==0)if(b+g<a)e=1;else if(a<b)e=2;switch(e){case 1:i.scrollTop=a;break;case 2:i.scrollTop=a-(g-c);break;case 3:i.scrollTop=a-(g-c)/2;break}window.fakeEvent={object:i};i.onscroll(window.fakeEvent);window.fakeEvent=
null}};var u;this.setRowHeight=function(b){u=b};var C=function(){if(u!=0)v.children[0].children[0].style.backgroundPosition="0px "+Math.floor(i.scrollTop/(2*u))*2*u+"px"};if(i.addEventListener)i.addEventListener("scroll",C);else i.attachEvent&&i.attachEvent("onscroll",C);w.adjustColumns()});
